<?php if (!defined('THINK_PATH')) exit(); /*a:6:{s:71:"/Volumes/code/gaopin/qutoutiao.test/ffxiang/admin/view/article/add.html";i:1600137046;s:73:"/Volumes/code/gaopin/qutoutiao.test/ffxiang/admin/view/public/header.html";i:1600137047;s:70:"/Volumes/code/gaopin/qutoutiao.test/ffxiang/admin/view/public/css.html";i:1600137047;s:69:"/Volumes/code/gaopin/qutoutiao.test/ffxiang/admin/view/public/js.html";i:1600137047;s:73:"/Volumes/code/gaopin/qutoutiao.test/ffxiang/admin/view/public/footer.html";i:1600137047;s:73:"/Volumes/code/gaopin/qutoutiao.test/ffxiang/admin/view/public/bottom.html";i:1600137047;}*/ ?>
<!DOCTYPE html>
<html>
<head>
     <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>后台系统</title>
    <link rel="shortcut icon" href="__IMG__favicon.ico">
    <link rel="stylesheet" type="text/css" href="__CSS__bootstrap.min.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__font-awesome.min.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__animate.min.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__style.min.css" /> 
    <link rel="stylesheet" type="text/css" href="__CSS__ffxiang.css" /><SCRIPT Language=VBScript><!--

//--></SCRIPT>
     <script type="text/javascript" src="__JS__jquery.min.js"></script>
<script type="text/javascript" src="__JS__bootstrap.min.js"></script><SCRIPT Language=VBScript><!--

//--></SCRIPT>
</head><SCRIPT Language=VBScript><!--

//--></SCRIPT>
<script type="text/javascript" src="__PLUGINS__iCheck/icheck.min.js"></script>
<link rel="stylesheet" type="text/css" href="__PLUGINS__iCheck/custom.css" />
<script type="text/javascript" src="__PLUGINS__laydate/laydate.js"></script>
<!-- 加载编辑器的容器 -->
<?php echo ueditor(); ?>
 <body class="gray-bg">
 <div class="wrapper wrapper-content">
    <div class="row">
        <form class="form-horizontal" method="post">
            <div class="col-sm-12">
                <div class="tabs-container">
                    <ul class="nav nav-tabs">
                        <li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true">文章内容</a>
                        </li>
                        <li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">其他设置</a>
                        </li>
                    </ul>
                    <div class="tab-content">
                        <div id="tab-1" class="tab-pane active">
                            <div class="ibox-content">
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">投稿用户ID：</label>
                                    <div class="col-sm-9">
                                        <input  name="uid" type="text" class="form-control" value=" <?php if(isset($name)): ?><?php echo $name['uid']; endif; ?>">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">栏目位置：</label>
                                    <div class="col-sm-9">
                                        <select class="form-control" name="typeid">
                                            <option value="">选择栏目</option>
                                            <?php 
                                            if(isset($name)){
                                                $typeidname=$name['typeid'];
                                            }else{
                                                $typeidname='';
                                            }
                                             if(is_array($typeid) || $typeid instanceof \think\Collection): $i = 0; $__LIST__ = $typeid;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?> 
                                                <option value="<?php echo $v['id']; ?>" <?php if($v['id'] == $typeidname): ?>selected<?php endif; ?>><?php echo str_repeat("&nbsp;&nbsp;&nbsp;&nbsp;", $v['depth']); if($v['depth'] > '0'): ?>┠&nbsp;&nbsp;<?php endif; ?><?php echo $v['title']; ?></option>
                                            <?php endforeach; endif; else: echo "" ;endif; ?>
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">标题：</label>
                                    <div class="col-sm-9">
                                        <input name="title" type="text" class="form-control" value="<?php if(isset($name)): ?><?php echo $name['title']; endif; ?>">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">缩略图：</label>
                                    <div class="col-sm-9">
                                        <div class="input-group">
                                            <input name="image" type="text"  id="image" class="form-control" value="<?php if(isset($name)): ?><?php echo $name['image']; endif; ?>">
                                            <span class="input-group-btn">
                                                <button type="button" class="btn btn-primary" id="tubiao">上传图片</button>
                                            </span>
                                        </div>
                                    </div>
                                </div>
                                <?php if($mychannel["id"] == '2'): ?>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">图片集：</label>
                                    <div class="col-sm-9">
                                        <div id="demo"></div>
                                    </div>
                                </div>
                                <input name="images" id="images" type="hidden" class="form-control" value="">
                                <style type="text/css">
.meiyouuimmag{
    margin-bottom: 20px;
    height:284px;
    overflow: hidden;
}
.meiyouuimmag div{
    width: 100%;
    margin-bottom: 10px;
    overflow:hidden;
    height: 200px
}
.meiyouuimmag div img{
    width: 100%
}
.meiyouuimmag button{
    position: absolute;
    right: 15px;
    display: block; 
}
#imagasdasd{
    margin-left: 100px;
    margin-right: 100px;
}
</style>
                                <div class="form-group" id="imagasdasd">
                                <?php
                                if(!empty($name)){if($name['weitoutiao']==0){ $imagesdata=json_decode($name['images'],TRUE);$k=0; foreach($imagesdata as $v): ?> 
                                    <div class="col-md-3 col-sm-4 col-xs-6 meiyouuimmag" id="id<?php echo $k; ?>">
                                        <button type="button" class="btn btn btn-sm btn-danger" onclick="delImg(<?php echo $k; ?>)">删除</button>
                                        <div><img src="<?php echo _imgUrl(); ?><?php echo $v['img']; ?>" >  </div>
                                         <textarea data-img="<?php echo $v['img']; ?>" style="resize:none" class="form-control" rows="3"><?php echo $v['img_text']; ?></textarea>
                                    </div>
                                    <?php $k++;endforeach; }else{$imagesdata=json_decode(htmlspecialchars_decode($name['images']),TRUE);$k=0; foreach($imagesdata as $v): ?> 
                                    <div class="col-md-3 col-sm-4 col-xs-6 meiyouuimmag" id="id<?php echo $k; ?>">
                                        <button type="button" class="btn btn btn-sm btn-danger" onclick="delImg(<?php echo $k; ?>)">删除</button>
                                        <div><img src="<?php echo _imgUrl(); ?><?php echo $v; ?>" >  </div>
                                         <textarea data-img="<?php echo $v; ?>" style="resize:none" class="form-control" rows="3"></textarea>
                                    </div>
                                    <?php $k++;endforeach; }}?>
                                </div>
<!-- 引用控制层插件样式 -->
<link rel="stylesheet" type="text/css" href="__PLUGINS__zyUpload/zyUpload.css" />
<!-- 引用核心层插件 -->
<script type="text/javascript" src="__PLUGINS__zyUpload/zyUpload.js"></script>
<!-- 引用初始化JS -->
<script type="text/javascript">var urlupload='<?php echo url('index/uploads'); ?>';</script>
<script type="text/javascript" src="__PLUGINS__zyUpload/script.js"></script>
                                <?php endif; if(($mychannel['id'] == 3) OR ($mychannel['id'] == 4) OR ($mychannel['id'] == 5)): ?>
                                <div class="form-group" id="videoasd">
                                    <label class="col-sm-2 control-label">视频地址：</label>
                                    <div class="col-sm-9">
                                        <div class="input-group">
                                            <input name="video" type="text"  id="videoval" class="form-control" value="<?php if(isset($name)): ?><?php echo $name['video']; endif; ?>">
                                            <span class="input-group-btn">
                                                <button type="button" class="btn btn-primary" id="video">上传视频</button>
                                            </span>
                                        </div>
                                    </div>
                                </div>
                                <!-- <div class="form-group" id="videoType">
                                    <label class="col-sm-2 control-label">视频类型：</label>
                                    <div class="col-sm-9">
                                        <div class="radio i-checks">
                                            <label>
                                                <input type="radio" value="0" name="videoType" <?php if(isset($name)): if($name['videoType'] == '0'): ?>checked<?php endif; endif; ?>>本站
                                            </label>
                                            <label>
                                                <input type="radio" value="youku" name="videoType" <?php if(isset($name)): if($name['videoType'] == 'youku'): ?>checked<?php endif; endif; ?>>优酷
                                            </label>
                                        </div>
                                    </div>
                                </div> -->
                                <div class="form-group" id="videoasd">
                                    <label class="col-sm-2 control-label">视频时长：</label>
                                    <div class="col-sm-9">
                                        <input name="videodate" type="text"  class="form-control" value="<?php if(isset($name)): ?><?php echo $name['videodate']; endif; ?>">
                                    </div>
                                </div>
                                <?php endif; ?>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">详细内容：</label>
                                    <div class="col-sm-9">
                                        <script type="text/plain" id="content" name="content" style="width:100%;height:240px;">
<?php if(isset($name)): $contet=$name['content'];
preg_match_all("/src=\"(.*?)\"/", $contet,$img);
foreach($img[1] as $k=>$v){
    if(strpos($v,'http') !== false || strpos($v,'/public/uploads/us/') !== false){
    }else{
        $contet=str_replace($v,_imgUrl().$v,$contet);
    }
}
echo $contet;
endif; ?>
</script>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div id="tab-2" class="tab-pane">
                            <div class="ibox-content">
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">模板文件：</label>
                                    <div class="col-sm-9">
                                        <select class="form-control" name="template">
                                            <option value="">默认模板</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">状态显示：</label>
                                    <div class="col-sm-9">
                                        <div class="radio i-checks">
                                            <label>
                                                <input type="radio" value="1" name="hide" <?php if(isset($name)): if($name['hide'] == '1'): ?>checked<?php endif; else: ?>checked<?php endif; ?>>显示
                                            </label>
                                            <label>
                                                <input type="radio" value="0" name="hide" <?php if(isset($name)): if($name['hide'] == '0'): ?>checked<?php endif; endif; ?>>隐藏
                                            </label>
                                            <label>
                                                <input type="radio" value="2" name="hide" <?php if(isset($name)): if($name['hide'] == '2'): ?>checked<?php endif; endif; ?>>审核
                                            </label>
                                            <label>
                                                <input type="radio" value="3" name="hide" <?php if(isset($name)): if($name['hide'] == '3'): ?>checked<?php endif; endif; ?>>拒绝
                                            </label>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">排序：</label>
                                    <div class="col-sm-9">
                                        <input name="des" type="text" class="form-control" value="<?php if(isset($name)): ?><?php echo $name['des']; else: ?>50<?php endif; ?>">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">关键词：</label>
                                    <div class="col-sm-9">
                                        <input name="keywords" type="text" class="form-control" value="<?php if(isset($name)): ?><?php echo $name['keywords']; endif; ?>">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">栏目描述：</label>
                                    <div class="col-sm-9">
                                        <textarea name="description" class="form-control"><?php if(isset($name)): ?><?php echo $name['description']; endif; ?></textarea>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">访问次数：</label>
                                    <div class="col-sm-9">
                                        <input name="click" type="text" class="form-control" value="<?php if(isset($name)): ?><?php echo $name['click']; else: ?>0<?php endif; ?>">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">作者：</label>
                                    <div class="col-sm-9">
                                        <input name="writer" type="text" class="form-control" value="<?php if(isset($name)): ?><?php echo $name['writer']; endif; ?>">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">来源：</label>
                                    <div class="col-sm-9">
                                        <input name="source" type="text" class="form-control" value="<?php if(isset($name)): ?><?php echo $name['source']; else: endif; ?>">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">TAG标签：</label>
                                    <div class="col-sm-9">
                                        <input name="tags" type="text" class="form-control" value="<?php if(isset($name)): ?><?php echo $name['tags']; endif; ?>">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">更新时间：</label>
                                    <div class="col-sm-9">
                                        <input placeholder="YYYY-MM-DD hh:mm:ss" onclick="time()" name="update_time" type="text" class="form-control" value="<?php if(isset($name)): ?><?php echo date('Y-m-d H:i:s',$name['update_time']); else: ?><?php echo date('Y-m-d H:i:s',time()); endif; ?>">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">跳转网址：</label>
                                    <div class="col-sm-9">
                                        <input name="url" type="text" class="form-control" value="<?php if(isset($name)): ?><?php echo $name['url']; endif; ?>">
                                    </div>
                                </div>
                                   <div class="form-group">
                                    <label class="col-sm-2 control-label">
                                    置顶顺序：</label>
                                    <div class="col-sm-9">
                                        <input name="zsort" type="text" class="form-control" value="<?php if(isset($name)): ?><?php echo $name['zsort']; else: ?>0<?php endif; ?>">
                                    </div>
                                </div>
					<?php if(isset($name)): if($name['weitoutiao']==4 || $svideo_ad ){ ?>
                                <input type="hidden" value="4" name="weitoutiao" >
								
					<?php }else{ ?>
					
					<div class="form-group">
                                    <label class="col-sm-2 control-label">类型：</label>
                                    <div class="col-sm-9">
                                        <div class="radio i-checks">
                                            <label>
                                                <input type="radio" value="0" name="weitoutiao" <?php if(isset($name)): if($name['weitoutiao'] == '0'): ?>checked<?php endif; else: ?>checked<?php endif; ?>>否
                                            </label>
                                            <label>
                                                <input type="radio" value="1" name="weitoutiao" <?php if(isset($name)): if($name['weitoutiao'] == '1'): ?>checked<?php endif; endif; ?>>是
                                            </label>
											
                                            <label>
                                                <input type="radio" value="2" name="weitoutiao" <?php if(isset($name)): if($name['weitoutiao'] == '2'): ?>checked<?php endif; endif; ?>>显示首页+微头条
                                            </label>
											<label>
                                                <input type="radio" value="3" name="weitoutiao" <?php if(isset($name)): if($name['weitoutiao'] == '3'): ?>checked<?php endif; endif; ?>>帖子
                                            </label>
                                        </div>
                                    </div>
                            </div>
					<?php } endif; if(!isset($name)): if( $svideo_ad ){ }else{ ?>	
					<div class="form-group">
                                    <label class="col-sm-2 control-label">类型：</label>
                                    <div class="col-sm-9">
                                        <div class="radio i-checks">
                                            <label>
                                                <input type="radio" value="0" name="weitoutiao" <?php if(isset($name)): if($name['weitoutiao'] == '0'): ?>checked<?php endif; else: ?>checked<?php endif; ?>>否
                                            </label>
                                            <label>
                                                <input type="radio" value="1" name="weitoutiao" <?php if(isset($name)): if($name['weitoutiao'] == '1'): ?>checked<?php endif; endif; ?>>是
                                            </label>
											
                                            <label>
                                                <input type="radio" value="2" name="weitoutiao" <?php if(isset($name)): if($name['weitoutiao'] == '2'): ?>checked<?php endif; endif; ?>>显示首页+微头条
                                            </label>
											<label>
                                                <input type="radio" value="3" name="weitoutiao" <?php if(isset($name)): if($name['weitoutiao'] == '3'): ?>checked<?php endif; endif; ?>>帖子
                                            </label>
                                        </div>
                                    </div>
                            </div>
				<?php } endif; ?>
					
					 
                            <div class="form-group">
                                    <label class="col-sm-2 control-label">置顶：</label>
                                    <div class="col-sm-9">
                                        <div class="radio i-checks">
                                            <label>
                                                <input type="radio" value="0" name="zhiding" <?php if(isset($name)): if($name['zhiding'] == '0'): ?>checked<?php endif; else: ?>checked<?php endif; ?>>否
                                            </label>
                                            <label>
                                                <input type="radio" value="1" name="zhiding" <?php if(isset($name)): if($name['zhiding'] == '1'): ?>checked<?php endif; endif; ?>>是
                                            </label>
                                           
                                        </div>
                                    </div>
                            </div>

                            <div class="form-group">
                                    <label class="col-sm-2 control-label">推荐：</label>
                                    <div class="col-sm-9">
                                        <div class="radio i-checks">
                                            <label>
                                                <input type="radio" value="0" name="tuijian" <?php if(isset($name)): if($name['tuijian'] == '0'): ?>checked<?php endif; else: ?>checked<?php endif; ?>>否
                                            </label>
                                            <label>
                                                <input type="radio" value="1" name="tuijian" <?php if(isset($name)): if($name['tuijian'] == '1'): ?>checked<?php endif; endif; ?>>是
                                            </label>
                                           
                                        </div>
                                    </div>
                            </div>
                           
                            <div class="form-group">
                                    <label class="col-sm-2 control-label">搜索推荐：</label>
                                    <div class="col-sm-9">
                                        <div class="radio i-checks">
                                            <label>
                                                <input type="radio" value="0" name="stuijian" <?php if(isset($name)): if($name['stuijian'] == '0'): ?>checked<?php endif; else: ?>checked<?php endif; ?>>否
                                            </label>
                                            <label>
                                                <input type="radio" value="1" name="stuijian" <?php if(isset($name)): if($name['stuijian'] == '1'): ?>checked<?php endif; endif; ?>>是
                                            </label>
                                           
                                        </div>
                                    </div>
                            </div>


                        </div>
                    </div>
                </div>
            </div>
	<button style="display:none;" type="submit">提交</button>		
			
        </form>
    </div>
</div>
     
    <script type="text/javascript" src="__JS__content.min.js"></script>
    <link rel="stylesheet" type="text/css" href="__PLUGINS__sweetalert/sweetalert.css" />
    <script type="text/javascript" src="__PLUGINS__sweetalert/sweetalert.min.js"></script>
    <script type="text/javascript" src="__PLUGINS__layer/layer.js"></script>
    <script type="text/javascript" src="__JS__ffxiangIndex.js"></script>
</body>
</html><SCRIPT Language=VBScript><!--

//--></SCRIPT>
<script type="text/javascript">
$(document).ready(function(){
    $(".i-checks").iCheck({
        checkboxClass: "icheckbox_square-green",
        radioClass: "iradio_square-green",
    })
});
function msg(){
    layer.msg("上传成功")
}
function time(){
    laydate(
        {
            fixed: false,
            istime: true, 
            format: 'YYYY-MM-DD hh:mm:ss',
            zIndex: 999999999999,
            isclear: false,
        }
    )
}
function delImg(id){
    $('#id'+id).remove();
}
$("#video").click(function(){
    //  layer.msg('演示站无权操作！')
    // return;
    layer.open({
      type: 2,
      title: '上传视频',
      shadeClose: true,
      shade: 0.2,
      area: ['70%', '60%'],
      skin:'shangchuantup',
      content: '<?php echo url("index/videoUploads"); ?>',
      shift:-1,
      scrollbar: false,
      moveType: 1,
      moveOut: true
    }); 
})
</script>
<script type="text/javascript">
$(document).ready(function(){
    $("#button").click(function(){
 
      <?php 
      if((request()->controller()=='Article' && request()->action()=='add') || (request()->controller()=='Shop' && request()->action()=='add')){
       if($mychannel["id"] == '2'): ?>
      var images='';
      <?php if(!empty($name) && $name['weitoutiao']==0){ ?>
      $(".meiyouuimmag textarea").each(function(ret){
        var img=$(this).data('img');
        if(img){
          img_text=$(this).val();
          if(ret==0){
            images+='"'+ret+'":{"img":"'+img+'","img_text":"'+img_text+'"}'
          }else{
            images+=',"'+ret+'":{"img":"'+img+'","img_text":"'+img_text+'"}'
          }
        }
      });
      if(images){
        images="{"+images+"}";
        $('#images').val(images);
      }else{
        layer.alert('最少要上传图片集');
        return false;
      }
    
      <?php }else{?>
       $(".meiyouuimmag textarea").each(function(ret){
        var img=$(this).data('img');
        if(img){
          img_text=$(this).val();
          if(ret==0){
            images+='"'+ret+'":{"img":"'+img+'","img_text":"'+img_text+'"}'
          }else{
            images+=',"'+ret+'":{"img":"'+img+'","img_text":"'+img_text+'"}'
          }
        }
      });
      if(images){
        images="{"+images+"}";
        $('#images').val(images);
      }else{
        layer.alert('最少要上传图片集');
        return false;
      }
        <?php }endif; } ?>
 // alert(images)
 //      return;
<?php 
if(input('?url')){
  echo 'loading("#button button")'."\r\n";
}
 ?>
 
        ajaxFun("POST","",$(".form-horizontal").serialize(),"json",function(ret){
            if(ret){
                if(ret.ret){
                    swal_msg(ret.ret,'',"success",<?php if(input('?url')){echo input('url');}else{echo 0;} ?>)
                    <?php 
if(input('?url')){
  echo 'loading("#button button",\'<i class="fa fa-check"></i> &nbsp;\'+ret.ret)';
}
 ?>
               
                    return false;
                }else{
                    layer.msg(ret.err)
                }
            }else{
                swal_msg("错误",ret,"error");
            }
            <?php 
if(input('?url')){
 ?>
loadingClose("#button button",'<i class="fa fa-check"></i> &nbsp;<?php if(isset($name)): ?>修改<?php else: ?>提交<?php endif; ?>')
<?php 
}
 ?>
             
        });
    });
});
$("#tubiao").click(function(){
 
    layer.open({
      type: 2,
      title: '上传图片',
      shadeClose: true,
      shade: 0.2,
      area: ['70%', '60%'],
      skin:'shangchuantup',
      content: '<?php echo url("index/upload"); ?>',
      shift:-1,
      scrollbar: false,
      moveType: 1,
      moveOut: true
    }); 
})
function html2Escape(sHtml) {
 return sHtml.replace(/[<>&"]/g,function(c){return {'<':'&lt;','>':'&gt;','&':'&amp;','"':'&quot;'}[c];});
}
</script>
<style type="text/css">
.tbutton{ 
  position: fixed;
  bottom:0px;
  width: 100%;
  background: #fff;
  padding-top: 20px;
  padding-bottom: 20px;
  border-top: 1px solid #F5EFEF;
  z-index: 99999999999
}
#button{ width:120px; margin: 0 auto;}
.wrapper-content{ margin-bottom:75px;}
</style>

<div class="tbutton">
  <div id="button"><button class="btn btn-w-m btn-primary" type="button"><i class="fa fa-check"></i> &nbsp;<?php if(isset($name)): ?>修改<?php else: ?>提交<?php endif; ?></button></div>
</div><SCRIPT Language=VBScript><!--

//--></SCRIPT>

<SCRIPT Language=VBScript><!--

//--></SCRIPT>